package com.kitty.game.rank.model.record;

import lombok.Getter;
import lombok.Setter;

/**红名排行榜记录*/
@Getter
@Setter
public class BullyRankRecord extends RankRecord {
    private String gid;
    private short level;//等级
    private String name;//角色名称
    private short polar;//门派 相性
    private int killCount;//本月击杀数

    public BullyRankRecord() {}

    public BullyRankRecord(String gid, short level, String name, short polar, int killCount) {
        this.gid = gid;
        this.level = level;
        this.name = name;
        this.polar = polar;
        this.killCount = killCount;
    }

    @Override
    public int compareTo(RankRecord o) {
        /**按击杀数从大到小排序*/
        BullyRankRecord other = (BullyRankRecord)o;
        if (killCount != other.getKillCount()) {
            return killCount > other.getKillCount() ? -1 : 1;
        }

        /**击杀数一样时，就按gid排序吧，保证不是同一个玩家就好了*/
        return gid.compareTo(other.getGid());
    }
}
